﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using QuanLyKhachSanDAO.DTO;
using QuanLyKhachSanDAO.DAO;

namespace QuanLyKhachSanDAO
{
    /// <summary>
    /// Summary description for Service1
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class Service1 : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }
        // ----------Phong-------------
        [WebMethod]
        public bool LapDanhMucPhong(PhongDTO ph)
        {
            PhongDAO phong = new PhongDAO();
            return phong.LapDanhMucPhong(ph);
        }
        [WebMethod]
        public PhongDTO[] LayDanhSachPhongTheoMaLoai(int maLoai)
        {
            PhongDAO phong = new PhongDAO();
            return phong.LayDanhSachPhongTheoMaLoai(maLoai);
        }
        [WebMethod]
        public PhongDTO[] LayDanhSachPhong()
        {
            PhongDAO p = new PhongDAO();
            return p.getDsPhong();
        }
        // ----------Loai Khach-------------
        [WebMethod]
        public LoaiKhachDTO[] LayDanhSachLoaiKhach()
        {
            LoaiKhachDAO lk = new LoaiKhachDAO();
            return lk.LayDanhSachLoaiKhach();
        }
        // ----------Loai Phong-------------
        [WebMethod]
        public LoaiPhongDTO[] LayDanhSachLoaiPhong()
        {
            LoaiPhongDAO lp = new LoaiPhongDAO();
            return lp.LayDanhSachLoaiPhong();
        }
        [WebMethod]
        public LoaiPhongDTO LoaiPhongTheoMa(int malp)
        {
            LoaiPhongDAO lp = new LoaiPhongDAO();
            return lp.LoaiPhongTheoMa(malp);
        }
        // ----------Khach Hang-------------
        //[WebMethod]
        //public object ThemDanhSachKhachThue(KhachHangDTO[] kh)
        //{
        //    KhachHangDAO khg = new KhachHangDAO();
        //    return khg.ThemDanhSachKhachThue(kh);
        //}
        // ----------Phieu Thue Phong-------------
        [WebMethod]
        public bool ThemPhieuThuePhong(PhieuThuePhongDTO pt,KhachHangDTO[] kh)
        {
            PhieuThuePhongDAO pthue = new PhieuThuePhongDAO();
            return pthue.ThemPhieuThue(pt,kh);
        }
    }
}